package com.zhangqiang.git.multipledatas.project.user.controller;


import com.zhangqiang.git.multipledatas.project.user.domain.User;
import com.zhangqiang.git.multipledatas.project.user.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class DemoController {

    @Autowired
    private UserService userService;

    @RequestMapping("/user/master")
    @ResponseBody
    public User master(String mobile) {
        return userService.findMasterUserByMobile(mobile);
    }

    @RequestMapping("/user/slave")
    @ResponseBody
    public User slave(String mobile) {
        return userService.findSlaveUserByMobile(mobile);
    }
}
